/*********************************************************************\
*
*                  (c) lkc
*                  All Rights Reserved. lkc Confidential
*
\*********************************************************************/
/*********************************************************************\
*   Title                      :
*
*   Module Description         :
*
*   Author                     : lkc
*
*   Created                    : 2019-11-8
*
\*********************************************************************/
#ifndef PROTOCOLHUANUO_H
#define PROTOCOLHUANUO_H

#include "Communicate.h"

#ifdef HUANUO_COMM_TYPE_IS_QT
#include <QObject>
#include "ProtocolBaseQt.h"
class ProtocolHuaNuo : public QObject, public ProtocolBaseQt
{
    Q_OBJECT
#else
#include "ProtocolBasePosix.h"
class ProtocolHuaNuo : public ProtocolBasePosix
{
#endif//#ifdef POD_COMM_TYPE_IS_QT
public:
    static ProtocolHuaNuo& GetInstance() {return m_Instance;}//获取实例
    ProtocolHuaNuo& operator = (const ProtocolHuaNuo&) = delete;
    ProtocolHuaNuo(const ProtocolHuaNuo&) = delete;
private:
    static ProtocolHuaNuo m_Instance;
    ProtocolHuaNuo() {}
public:
    void ExtractData(const unsigned char* data, int nLength) override;
    int CycleSendOnce() override;
private:
    int GetCycleTimeMS() override {return 100;}
private:
    const static unsigned char HEAD1 = 0xE0;
    const static unsigned char HEAD2 = 0x01;
    const static unsigned char DEV_ADDR = 0xA1;
    const static unsigned char END = 0xFB;
};

#endif // PROTOCOLHUANUO_H

/********************************************************************\
 *
 * REVISION RECORDS
 *
\*********************************************************************/
/*********************************************************************/
/*
 *
 *
 *
\*********************************************************************/
/*------------------------------The End------------------------------*/


